package Alex;

import org.testng.annotations.*;
import static org.junit.Assert.*;
import Alex.model.User;
import Alex.model.Film;

public class AddMovie extends Alex.pages.TestBase {
  
	@BeforeMethod
	  public void mayBeLogout() {
	    if (app.getUserHelper().isNotLoggedIn()) {
	      return;
	    }
	    app.getUserHelper().logout();
	  }

  @Test
  public void movieIsAdded(){
	  User user = new User().setLogin("admin").setPassword("admin");
	  app.getUserHelper().loginAs(user);
	  Film film = new Film().setTitle("Java").setAka("bla-bla").setYear("2222").setDuration("100").setRating("4");
	  app.getFilmHelper().create(film);
  }
 
}

